<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>OL</title>
    <link rel="stylesheet" href="lib/ol.css" type="text/css">
    <link rel="stylesheet" href="style/map.css" type="text/css">
    <style>
        .legend {
            position: absolute;
            bottom: 1rem;
            left: 1rem;
            z-index: 99;
            background-color: rgba(255, 255, 255, 0.75);
            box-shadow: 1px 1px 4px #ccc;
            padding: 6px;
            font-size: 12px;
        }
        .legend .title {
            font-weight: bold;
            padding: 3px 3px 6px 3px;
        }
        .legend .content {
            list-style: none;
            margin: 0;
            padding: 0;
            white-space: nowrap;
            overflow: hidden;
        }
        .legend .content li {
            padding: 3px 0;
        }
        .legend .content .color {
            display: inline-block;
            width: 0.8rem;
            height: 0.8rem;
            margin-right: 0.3rem;
        }

        .legend .content .colors {
            width: 14px;
            height: 100px;
            background: linear-gradient(blue 25%, yellow 50%, orange 75%, red 100%);
            float: left;
            margin-right: 3px;
        }
        .legend .content .labels {
            float: left;
            overflow: hidden;
            list-style: none;
            margin: 0;
            padding: 0;
            white-space: nowrap;
        }
        .legend .content .labels li {
            height: 25px;
            line-height: 25px;
            padding: 0;
        }
    </style>
    <script src="lib/ol.js"></script>
</head>
<body>
<div id="map" class="map">

    <div class="legend">
        <div class="title">图例</div>
        <div class="content">
            <canvas id="legends"></canvas>
        </div>
    </div>
</div>
<script src="js/chapter9-5.js"></script>
</body>
</html>